<template>
  <el-tooltip content="计时器">
    <el-button type="primary" link @click="handleClick">
      <el-icon>
        <Timer />
      </el-icon>
    </el-button>
  </el-tooltip>
</template>

<script setup>
import { computed } from "vue";
import useJournalStore from "@/store/journal.js";
const journalStore = useJournalStore();

const handleClick = () => {
  journalStore.timerStatus.showMainWindow =
    !journalStore.timerStatus.showMainWindow;
};

const isActive = computed(
  () =>
    journalStore.timerStatus.startTimestamp > 0 &&
    journalStore.timerStatus.startTimestamp <
      journalStore.timerStatus.targetTimestamp
);
</script>
